//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.ComponentModel;

namespace EntLibContrib.Resource.Configuration.Design
{
	/// <summary>
	/// Abstract resource name type to hold the common attributes of a resource name
	/// </summary>
	public abstract class ResourceName : IResourceName
	{
		#region Fields
		private string baseName;
		#endregion
			
		#region Properties
		/// <summary>
		/// Gets or sets the resource base name.
		/// </summary>
		/// <value>The resource base name.</value>
		[ReadOnly(true)]
		[ResourceDescription("ResourceBaseNameDescription")]
		public virtual string BaseName
		{
			get
			{
				return this.baseName;
			}
			set
			{
				if (!String.IsNullOrEmpty(value))
					this.baseName = value.Trim();
			}
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceName"/> class.
		/// </summary>
		protected ResourceName()
			: this(String.Empty)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceName"/> class.
		/// </summary>
		/// <param name="baseName">the resource base name.</param>
		protected ResourceName(string baseName)
		{
			this.baseName = baseName;
		}
		#endregion
	}
}
